<template>
	<view>
		<uni-popup ref="popup" type="center">
			<view class="cusdialog">
				<view class="flex justify-between align-center mb-40">
					<view class="img-40"></view>
					<view class="size-28 color-white">{{title}}</view>
					<image src="../../static/imgs/2.png" class="img-40" @click="close"></image>
				</view>
				<slot></slot>
				<button class="cusdialog-btn size-26" @click="confrim" v-if="isAddress">{{btnTxt}}</button>
				<view class="cusdialog-btn size-26" style="opacity: 0.5;" v-else>{{btnTxt}}</view>
			</view>
			
		</uni-popup>
	</view>
</template>

<script>
	export default {
		name:"cusDialog",
		props:{
			title:{
				type:String,
				default:'标题'
			},
			btnTxt:{
				type:String,
				default:'确认'
			},
			isAddress:{
				type:Boolean,
				default: true
			}
		},
		data(){
			return{
			
			}
		},
		mounted(){},
		methods:{
			open(){
				this.$refs.popup.open()
			},
			close(){
				this.$refs.popup.close()
			},
			confrim(){
				this.$emit('confrim')
			}
		}
	}
</script>

<style lang="scss">
.cusdialog{
	width: 590rpx;
	border-radius: 30rpx;
	background-color: #1D1E25;
	padding: 30rpx;
	.cusdialog-btn{
		height: 80rpx;
		border-radius: 20rpx;
		margin-top: 30rpx;
	}
}
</style>